<?php
	include('classess/db_connection.php');	
	if(isset($_GET['dif_id'])){
		$val = explode('.',$_GET['dif_id']);
		$select_query  = "SELECT * FROM tbl_affiliate WHERE reference_url='".$val[0]."'";
		$query = mysql_query($select_query) or die(mysql_error());
		if(mysql_num_rows($query)>0){
			$select_course  = "SELECT * FROM tbl_courses WHERE id='".$val[1]."' AND is_active='1'";
			$query_course = mysql_query($select_course) or die(mysql_error());
			if(mysql_num_rows($query_course)>0){
				$extension_img = '';
				while($rows = mysql_fetch_array($query_course)){
					$temp_img = explode(".", $rows['course_image']);
					$extension_img = end($temp_img);
				}
				echo '<a href="http://rvtraining.net/course_description.php?home=1&c_id='.$val[1].'&ref_by='.$val[0].'" target="_blank"><img src="http://rvtraining.net/admin/dashboard/course_image/'.$val[1].'/'.$val[1].'.'.$extension_img.'" style="width:100%; height:90%;"></a>';
			}
		}
	}
	
?>